<?php
//// +----------------------------------------------------------------------
//// | ThinkPHP [ WE CAN DO IT JUST THINK ]
//// +----------------------------------------------------------------------
//// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
//// +----------------------------------------------------------------------
//// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
//// +----------------------------------------------------------------------
//// | Author: liu21st <liu21st@gmail.com>
//// +----------------------------------------------------------------------



Route::group('api/:version.Token',function(){
  
    Route::post('/token','api/:version.Token/getToken');
    Route::post('/verify','api/:version.Token/verify');

});
//首页分类



Route::group('api/:version.HomeCate',function(){
   Route::get('/select','api/:version.HomeCate/select');
  
});

//首页楼层

Route::group('api/:version.Floor',function(){
   Route::get('/select','api/:version.Floor/select');
  
});


//分类
Route::group('api/:version.Category',function(){
    Route::put('/edit/:id','api/:version.Category/edit');
	Route::get('/select','api/:version.Category/select');
    Route::get('/all','api/:version.Category/all');
	Route::post('/add','api/:version.Category/add');
    Route::get('/delete/:id','api/:version.Category/delete');
    Route::get('/detail/:id','api/:version.Category/detail');

});


//七牛云
Route::group('api/:version.Qny',function(){
   Route::post('/upload','api/:version.Qny/upload');
   Route::get('/delete/:images/id/:uid','api/:version.Qny/delete');
});


//用户
Route::group('api/:version.User',function(){

    Route::get('/select','api/:version.User/select');
    Route::post('/add','api/:version.User/add');
    Route::get('/delete/:id','api/:version.User/delete');
    Route::get('/detail/:id','api/:version.User/detail');
    Route::post('/edit','api/:version.User/edit');
});

//管理员
Route::group('api/:version.Admin',function(){
    Route::post('/check','api/:version.Admin/check');
    Route::get('/select','api/:version.Admin/select');
    Route::post('/add','api/:version.Admin/add');
    Route::get('/delete/:id','api/:version.Admin/delete');
    Route::get('/detail/:id','api/:version.Admin/detail');
    Route::put('/edit/:id','api/:version.Admin/edit');
    Route::put('/status/:uid/state/:type','api/:version.Admin/status');
    Route::get('/delAll/:ids','api/:version.Admin/delAll',[],['ids'=>'[0-9,]+']);
});


// //商店
// Route::group('api/:version.Store',function(){
//     Route::get('/select','api/:version.Store/select');
//     Route::post('/add','api/:version.Store/add');
//     Route::get('/delete/:id','api/:version.Store/delete');
//     Route::get('/detail/:id','api/:version.Store/detail');
//     Route::post('/edit','api/:version.Store/edit');
// });

//地址
// Route::group('api/:version.Address',function(){
//     Route::get('/select','api/:version.Address/select');
//     Route::post('/add','api/:version.Address/add');
//     Route::get('/delete/:id','api/:version.Address/delete');
//     Route::get('/detail/:id','api/:version.Address/detail');
//     Route::post('/edit','api/:version.Address/edit');
//     Route::get('/det/:uid','api/:version.Address/det');
// });


//轮播图
Route::group('api/:version.Banner',function (){
    Route::get('/select','api/:version.Banner/select');
    Route::post('/add','api/:version.Banner/add');
    Route::get('/delete/:id','api/:version.Banner/delete');
    Route::get('/detail/:id','api/:version.Banner/detail');
    Route::put('/edit/:id','api/:version.Banner/edit');
});


//商品
Route::group('api/:version.Goods',function (){
    Route::get('/search','api/:version.Goods/search');//搜索
    Route::get('/select','api/:version.Goods/select');//全部商品
    Route::post('/add','api/:version.Goods/add');
    Route::get('/delete/:id','api/:version.Goods/delete');
    Route::get('/detail/:id','api/:version.Goods/detail');
    Route::get('/adminDetail/:id','api/:version.Goods/adminDetail');
    Route::put('/edit/:id','api/:version.Goods/edit');
    Route::get('/det/:store_id','api/:version.Goods/det');//指定店铺的商品
    Route::get('/cateSel/:category_id','api/:version.Goods/cateSel');//指定栏目下的商品
    Route::get('/typeSel','api/:version.Goods/typeSel');//指定类型下的商品
    Route::get('/show/','api/:version.Goods/show');
    Route::get('/propaganda','api/:version.Goods/propaganda');
    Route::get('/status/:id/on_sale/:on_sale','api/:version.Goods/status');
    Route::get('/pstatus/:id/propaganda/:propaganda','api/:version.Goods/pstatus');
});

//类型
Route::group('api/:version.Type',function (){
    Route::get('/select','api/:version.Type/select');
    Route::post('/add','api/:version.Type/add');
    Route::get('/delete/:id','api/:version.Type/delete');
    Route::get('/detail/:id','api/:version.Type/detail');
    Route::post('/edit','api/:version.Type/edit');
});


// //客服
// Route::group('api/:version.Chat',function (){
//     Route::post('/get_head','api/:version.Chat/get_head');
//     Route::post('/get_name','api/:version.Chat/get_name');
//     Route::post('/changeNoRead','api/:version.Chat/changeNoRead');
//     Route::post('/load','api/:version.Chat/load');
//     Route::post('/get_list','api/:version.Chat/get_list');
// });

//购物车
Route::group('api/:version.Cart',function (){
    Route::post('/addToCart','api/:version.Cart/addToCart');
    Route::get('/select','api/:version.Cart/select');
    Route::get('/clear','api/:version.Cart/clearCart');
    Route::get('/delCart/:cartId','api/:version.Cart/delCart',[],['cartId'=>'[0-9-,]+']);
    Route::post('/updateCart','api/:version.Cart/updateCart');
    Route::get('/detailCart/:cartId','api/:version.Cart/detailCart',[],['cartId'=>'[0-9-,]+']);
    Route::get('/deleteCartGoods/:cart_value','api/:version.Cart/deleteCartGoods',[],['cart_value'=>'[0-9-,@]+']);

});

//订单号
Route::group('api/:version.My',function (){
    Route::post('/order','api/:version.My/order');
    Route::get('/select','api/:version.My/select');
    Route::get('/detail/:id','api/:version.My/detail');

});
//支付
Route::group('api/:version.Pay',function (){
    Route::post('/order','api/:version.Pay/order');
});

//后台订单
Route::group('api/:version.Order',function (){
    Route::get('/select','api/:version.Order/select');
});


//收藏,有用到
Route::group('api/:version.Collect',function (){
    
    Route::get('/collect','api/:version.Collect/collect');
    Route::get('/cancel','api/:version.Collect/cancel');
    Route::get('/select/:uid','api/:version.Collect/select');

});

//权限,有用到
Route::group('api/:version.Auth',function (){
    
    Route::get('/select','api/:version.Auth/select');
    Route::get('/all','api/:version.Auth/all');
    Route::get('/delete/:id','api/:version.Auth/delete');
    Route::get('/detail/:id','api/:version.Auth/detail');
    Route::post('/add','api/:version.Auth/add');
    Route::put('/edit/:id','api/:version.Auth/edit');
   
});

//分类参数,有用到
Route::group('api/:version.Attr',function (){
    
    Route::get('/select/:id','api/:version.Attr/select');
    Route::post('/add','api/:version.Attr/add');
    Route::get('/detail/:id','api/:version.Attr/detail');
    Route::put('/edit/:id','api/:version.Attr/edit');
    Route::get('/delete/:id','api/:version.Attr/delete');
    Route::put('/insert/:type_id/attrid/:id','api/:version.Attr/insert');
   
});

//优惠卷,有用

Route::group('api/:version.Coupons',function (){
    
    Route::get('/select','api/:version.Coupons/select');
    Route::get('/sel','api/:version.Coupons/sel');
    Route::get('/detail/:id','api/:version.Coupons/detail');
    Route::get('/delete/:id','api/:version.Coupons/delete');
    Route::post('/add','api/:version.Coupons/add');
    Route::put('/edit/:id','api/:version.Coupons/edit');
      Route::get('/delAll/:ids','api/:version.Coupons/delAll',[],['ids'=>'[0-9,]+']);
   
});

//秒杀，有用
Route::group('api/:version.Seckill',function (){
    
    Route::get('/select','api/:version.Seckill/select');
  
    Route::get('/detail/:id','api/:version.Seckill/detail');
    Route::get('/delete/:id','api/:version.Seckill/delete');
    Route::post('/add','api/:version.Seckill/add');
    Route::put('/edit/:id','api/:version.Seckill/edit');
    Route::get('/delAll/:ids','api/:version.Seckill/delAll',[],['ids'=>'[0-9,]+']);
    Route::put('/status/:id/state/:status','api/:version.Seckill/status');

    //秒杀商品
    Route::post('/goods/:id','api/:version.Seckill/goods');
    Route::get('/selgoods','api/:version.Seckill/selgoods');
    Route::get('/delgoods/:gid/id/:id','api/:version.Seckill/delgoods');
    Route::get('/goodsDetail/:id','api/:version.Seckill/goodsDetail');
    
   
});


Route::group('api/:version.Evaluation',function (){
    
    Route::get('/select/:id','api/:version.Evaluation/select');

    Route::get('/delete/:id','api/:version.Evaluation/delete');
    Route::post('/add','api/:version.Evaluation/add');
   
   
});

return [

];
